
package ch.hearc.coursJava.GUI.frame.hello;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;


//Le prof n aime pas trop cette solution
public class EcouteurAllBoutons implements ActionListener
	{


	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public EcouteurAllBoutons(JButton bouton1, JButton bouton2)
		{
		this.bouton1 = bouton1;
		this.bouton2 = bouton2;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public void actionPerformed(ActionEvent e)
		{
		JButton source = (JButton)e.getSource();
		if(source==bouton1)
			{
			System.out.println("Hello from bouton 1bis");
			}
		else if(source==bouton2)
			{
			System.out.println("Hello from bouton 2bis");
			}
		else
			{
			//Rien!
			}

		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	//inputs
	private JButton bouton1;
	private JButton bouton2;


	}

